<template>
	<div id="">
		<baidu-map class="bm-view" :center="center" :zoom="zoom" @ready="handler">
			<!-- 显示物小圆点 -->
			<bm-marker :position="{lng: 114.624708, lat: 33.785698}" :dragging="true"></bm-marker>
		</baidu-map>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				center: {
					lng: 0,
					lat: 0
				},
				zoom: 3
			}
		},

		methods: {
			handler({
				BMap,
				map
			}) {
				// 家里
				// 114.624708,33.785698
				console.log(BMap, map)
				// 经度
				this.center.lng = 114.624708
				// 纬度
				this.center.lat = 33.785698
				// 地图放大等级
				this.zoom = 10
				// 开启鼠标缩放功能
				map.enableScrollWheelZoom(true)
			}
		},
	}
</script>

<style>
	.bm-view {
		width: 100%;
		height: 40vh;
	}
</style>
